<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/tabdemo.css"/>
	</head>
	<body>
		<!-- 179000611王少琦 -->
		<div class="tabox">
		      <div class="hd">
		        <ul>
		          <li class="on">疯狂抢购</li>
		          <li class=" ">猜您喜欢</li>
		          <li class=" ">热卖商品</li>
		          <li class=" ">热评商品</li>
		          <li class=" ">新品上架</li></ul>
		      </div>
		      <div class="bd">
		        <ul class="lh">
		          <img src="img/p1.jpg" >
		        </ul>
		        <ul class="lh" style="display: none;">
		          <img src="img/p2.jpg" >
		        </ul>
		        <ul class="lh" style="display: none;">
		          <img src="img/p3.jpg" >
		        </ul>
		        <ul class="lh" style="display: none;">
		          <img src="img/p4.jpg" >
		        </ul>
		        <ul class="lh" style="display: none;">
		          <img src="img/p5.jpg" >
		        </ul>
		      </div>
		</div>
		<div class="game">
			
		</div>
		<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
		<script src="js/tab_task.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(".hd li").click(function(){
				//获取元素下标
				var index = $(this).index();
				//让第index 个显示出来，其他隐藏
				$(".bd ul").eq(index).show().siblings().hide();
				//改变选中选项卡样式
				$(this).addClass("on").siblings().removeClass("on");
			});
		</script>
	</body>
</html>
